package com.ny.entity;

public class Result {
    private Integer code;
    private String msg;
    private Object data;

    // 成功静态方法
    public static Result success(Object data) {
        Result result = new Result();
        result.code = 200;
        result.msg = "成功";
        result.data = data;
        return result;
    }

    // 错误静态方法
    public static Result error(String msg) {
        Result result = new Result();
        result.code = 500;
        result.msg = msg;
        return result;
    }

    // Getter和Setter
    public Integer getCode() { return code; }
    public void setCode(Integer code) { this.code = code; }

    public String getMsg() { return msg; }
    public void setMsg(String msg) { this.msg = msg; }

    public Object getData() { return data; }
    public void setData(Object data) { this.data = data; }
}